package com.weixin.paleituo.factory;




/**
 * @描述	     创建普通线程池,创建下载线程池
 *

 */
public class ThreadFactory {
	static ThreadPoolProxy mNormalPool;	// 只需初始化一次就行了
	static ThreadPoolProxy	mDownLoadPool;	// 只需初始化一次就行了
	static ThreadPoolProxy mCheckHeartPool;

	/**
	 * 创建了一个普通的线程池
	 * @return
     */
	public static ThreadPoolProxy getNormalPool() {
		if (mNormalPool == null) {
			synchronized (ThreadFactory.class) {
				if (mNormalPool == null) {
					mNormalPool = new ThreadPoolProxy(10, 15, 3000);
				}
			}
		}
		return mNormalPool;
	}

	/**
	 * 创建了一个下载的线程池
	 * @return
     */
	public static ThreadPoolProxy getDownLoadPool() {

		if (mDownLoadPool == null) {
			synchronized (ThreadFactory.class) {
				if (mDownLoadPool == null) {
					mDownLoadPool = new ThreadPoolProxy(25, 25, 3000);
				}
			}
		}
		return mDownLoadPool;
	}/**
	 * 创建了一个心跳线程池
	 * @return
     */
	public static ThreadPoolProxy getCheckHeartPool() {

		if (mCheckHeartPool == null) {
			synchronized (ThreadFactory.class) {
				if (mCheckHeartPool == null) {
					mCheckHeartPool = new ThreadPoolProxy(10, 15, 6000);
				}
			}
		}
		return mCheckHeartPool;
	}
}
